//
//  SquareViewController.m
//  HappyMother
//
//  Created by yidong on 2017/10/23.
//  Copyright © 2017年 东哥. All rights reserved.
//

#import "SquareViewController.h"
#import "QuestionsAnswersViewController.h"


@interface SquareViewController ()

@end

@implementation SquareViewController

- (void)viewDidLoad {
    
    [super viewDidLoad];
    
    self.view.backgroundColor = [UIColor whiteColor];
    
    self.title = @"广场";
    
    [self createUI];
    
}
#pragma mark - 创建界面
-(void)createUI{
    
    UIButton *btnone = [[UIButton alloc] initWithFrame:CGRectMake(40, 150, Screen_Width-80, 40)];
    [btnone setBackgroundColor:COLOR];
    [self.view addSubview:btnone];
    [btnone setTitle:@"话题交流" forState:UIControlStateNormal];
    [btnone addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
    
    
    UIButton *btntwo = [[UIButton alloc] initWithFrame:CGRectMake(40, CGRectGetMaxY(btnone.frame)+10, Screen_Width-80, 40)];
    
    [btntwo setBackgroundColor:COLOR];
    [self.view addSubview:btntwo];
    [btntwo setTitle:@"问答解惑" forState:UIControlStateNormal];
    [btntwo addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
    
    UIButton *btnthree = [[UIButton alloc] initWithFrame:CGRectMake(40, CGRectGetMaxY(btntwo.frame)+10, Screen_Width-80, 40)];
    
    [btnthree setBackgroundColor:COLOR];
    [self.view addSubview:btnthree];
    [btnthree setTitle:@"音频内容" forState:UIControlStateNormal];
    [btnthree addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
    
}

-(void)click:(UIButton *)btn{
 
#warning 未创建导航栏控制器 需自己创建
    if ([btn.currentTitle isEqualToString:@"话题交流"]) {
        
        
        
    }else if ([btn.currentTitle isEqualToString:@"问答解惑"]){
        
       QuestionsAnswersViewController *qavc = [[QuestionsAnswersViewController alloc] init];
       UINavigationController *navi = [[UINavigationController alloc] initWithRootViewController:qavc];
        qavc.presentEnter = YES;
        
        qavc.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;
        
        [self presentViewController:navi animated:1 completion:nil];
        
        
    }else if ([btn.currentTitle isEqualToString:@"音频内容"]){
      
        
        
        
    }
    
    
}

@end
